package com.cskaoyan.controller;

import com.cskaoyan.bean.Region;
import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.service.MarketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("admin/region")
public class RegionController {

    @Autowired
    MarketService marketService;

    @RequestMapping("list")
    public BaseRespVo getRegionList(){
        BaseRespVo baseRespVo = new BaseRespVo();
        List<Region> regionList = marketService.getRegionList();
        baseRespVo.setData(regionList);
        baseRespVo.setErrno(0);
        baseRespVo.setErrmsg("成功");
        return baseRespVo;
    }
}




